<!--
 * @Author: ckk
 * @Date: 2022-08-15 17:33:04
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-07-20 14:58:41
 * @Description: 一行三个
-->
<template>
  <div class="two-content" :style="{ marginTop:datas.pageMargin, marginBottom:datas.pageMargin}">
    <div
      class="content-item"
      v-for="(item, index) in datas.imageList"
      :key="index"
      @click="goOhter(item)"
      :style="{ borderRadius: datas.borderRadius + 'px', }">
      <div class="content-img">
        <div class="study-pic">
          <img class="suolutu" :src="item.src" alt="" />
          <div class="jiaobiao" v-show="item.isVipShow === 1">
            <img v-show="item.vipObj.isVipShow" src="../../../assets/images/jbvip.png" alt="" />
          </div>
          <img class="jiaobiao1" v-show="item.vipObj.isProductShow" src="../../../assets/images/jbbuy.png" alt="" />
          <img class="jiaobiao1" v-show="item.vipObj.isExperienceShow" src="../../../assets/images/jbtiyan.png" alt="" />
        </div>
        <div class="study-num">
          <span class="study-status">共 {{ item.courseNum || 0 }} 节</span>
        </div>
      </div>
      <div class="course-info">
        <p class="content-title" :style="{ fontWeight: datas.textWeight }">{{ item.text }}</p>
        <div class="playNum">
          <img src="../../../assets/images/newPlay.png" alt="" />
          <span>{{ item.viewCount }}人已学</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'twoContent',
  props: {
    datas: Object
  },
  data () {
    return {
    };
  },
  methods: {
    goOhter (item) {
      this.$emit('goDetail', item);
    }
  }
};
</script>

<style scoped lang="scss">
.two-content {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  padding: 0 16px;
  justify-content: space-between;
  .content-item {
    width: 105px;
    height: 184px;
    background: #ffffff;
    margin-bottom:10px;
    box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.1);
  }
  .content-img {
    width: 100%;
    height: 105px;
    position: relative;
    .study-pic{
      .suolutu{
        width: 100%;
        height: 105px;
        border-top-right-radius: 8px;
        border-top-left-radius: 8px;
      }
      .jiaobiao{
        width: 24px;
        height: 18px;
        position: absolute;
        top: -14px;
        right: 0;
        border-radius: 0px;
      }
      .jiaobiao1{
        width: 30px;
        height: 18px;
        position: absolute;
        top: 0;
        right: 0;
      }
    }
    .study-num {
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 100%);
      span {
        padding-left: 5px;
        font-size: 12px;
        color: #ffffff;
      }
    }
  }
  .course-info{
   height: 79px;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
   padding-bottom:6px;
   box-sizing: border-box;
  }
}
.content-title {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 20px;
  padding: 10px 6px 0 6px;
  font-size: 14px;
  font-family: PingFang SC-Heavy, PingFang SC, sans-serif;
  font-weight: 800;
  color: #333333;
  width:100%;
  overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
  box-sizing: border-box;
}
.playNum{
  display: flex;
  align-items: center;
  padding: 0 6px;
  box-sizing: border-box;
  img{
    width:14px;
    height: 14px;
    display: block;
    margin-right:4px;
  }
  span{
    font-size: 12px;
    font-family: PingFang SC-Regular, PingFang SC, sans-serif;
    font-weight: 400;
    color: #666666;
  }
}
</style>
